package com.deep.bilibili;


import com.deep.bilibili.util.SpringUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;


@EnableJpaRepositories
@EnableCaching
@SpringBootApplication
@MapperScan("com.deep.bilibili.dao")
@ImportResource(locations = {"classpath:kaptcha/kaptcha.xml"})
public class BilibiliApplication {

    @Bean
    public ServletListenerRegistrationBean<SpringUtil> servletListenerRegistrationBean() {
        ServletListenerRegistrationBean<SpringUtil> servletListenerRegistrationBean = new ServletListenerRegistrationBean<SpringUtil>();
        servletListenerRegistrationBean.setListener(new SpringUtil());
        return servletListenerRegistrationBean;
    }

    public static void main(String[] args) {
        SpringApplication.run(BilibiliApplication.class, args);
    }

}
